{/* LAYOUT模板 */}
	<layout name="layout"/>
{/* LAYOUT模板 */}
{/* import Js,Css */}
	<js href="__PUBLIC__/js/admin/listTable.js"/>
	<js href="__PUBLIC__/js/admin/js.util.js"/>
	<css href="__PUBLIC__/css/admin/common.css"/>
	<js href="__PUBLIC__/js/admin/js.selectzone.js"/>
	
	<css href="__PUBLIC__/css/jquery-ui.css" />
	<js href="__PUBLIC__/js/core/jquery-ui.1.10.4.js" />
	<js href="__PUBLIC__/js/core/plugins.js"/>
{/* import js,css */}
<!-- [position] -->
	<include file="Template:position"/>
<!-- [position] -->

<style>
.qs-alert{padding:5px;color:#404040;}
</style>
<div class="alert alert-success qs-alert">
	<form action="javascript:searchMsg()" name="searchForm">
		<img src="__PUBLIC__/image/admin/icon_search.gif" width="26" height="22" border="0" alt="SEARCH" />
		类型: 
		<select name="msg_type">
			<option value="-1">请选择...</option>
			<volist name="msg_type" id="type" key="key">
				<option value="{$key}">{$type}</option>
			</volist>
		</select>
		留言标题:<input type="text" name="keyword" /> 
		<input type="submit" class="btn btn-default" style="background:#5CB85C;color:#fff;"  value="搜索" />
	</form>
</div>

<form method="POST" action="user_msg.php?act=batch_drop" name="listForm" onsubmit="return confirm_bath()">
	<div class="list-div" id="listDiv">
		<table class="table" cellpadding="3" cellspacing="1" width="100%" border="1">
			<tr>
				<th>
					<input onclick='listTable.selectAll(this, "checkboxes")' type="checkbox" />
					<a href="javascript:listTable.sort('msg_id'); "> 编号</a>{$sort_msg_id}
				</th>
				<th><a href="javascript:listTable.sort('user_name'); ">用户名</a>{$sort_user_name}</th>
				<th><a href="javascript:listTable.sort('msg_title'); ">留言标题</a>{$sort_msg_title}</th>
				<th><a href="javascript:listTable.sort('msg_type'); ">类型</a>{$sort_msg_type}</th>
				<th><a href="javascript:listTable.sort('msg_time'); ">留言时间</a>{$sort_msg_time}</th>
				<th><a href="javascript:listTable.sort('msg_status'); ">状态</a>{$sort_msg_status}</th>
				<th><a href="javascript:listTable.sort('reply'); ">回复</a>{$sort_reply}</th>
				<th>操作</th>
			</tr>
			<volist name="msg_list" id="msg">
			<tr>
				<td>
					<input type="checkbox" name="checkboxes[]" value="{$msg.msg_id}" />{$msg.msg_id}
				</td>
				<td align="left">{$msg.user_name}</td>
				<td align="left">{$msg.msg_title}</td>
				<td align="left">
					{$msg.msg_type}
					<if condition="$msg['order_id']">
					<br>
					<a href="order.php?act=info&order_id={$msg.order_id}">
						{$msg.order_sn}
					</a>
					</if>
				</td>
				<td align="left"  nowrap="nowrap">{$msg.msg_time}</td>
				<if condition="$msg['msg_area'] eq 0">
					<td align="center">显示</td>
				<else/>
					<td align="center">
						<if condition="$msg['msg_status'] eq 0">
							隐藏
						<else/>
							显示
						</if>
					</td>
				</if>
				<td align="center">
					<if condition="$msg['reply'] eq 0">
						未回复
					<else/>
						已回复
					</if>
				</td>
				<td align="left">
					<a href="__URL__/view_msg?id={$msg.msg_id}" title="查看详情">
						<img src="__PUBLIC__/image/admin/icon_view.gif" border="0" height="16" width="16" />
					</a>
					<a href="__URL__/del_msg?id={$msg.msg_id}" title="移除">
						<img src="__PUBLIC__/image/admin/icon_drop.gif" border="0" height="16" width="16">
					</a>
				</td>
			</tr>
			</volist>
			<tr>
				<td align="center">&nbsp;</td>
				<td align="center">&nbsp;</td>
				<td align="center">&nbsp;</td>
				<td align="center">&nbsp;</td>
				<td align="center">&nbsp;</td>
				<td align="center">&nbsp;</td>
				<td align="center">&nbsp;</td>
				<td align="center">&nbsp;</td>
			</tr>
		</table>
		<include file="Library:paginator"/>
	</div>
</form>

<script type="text/javascript" language="JavaScript">

	onload = function(){
		document.forms['searchForm'].elements['keyword'].focus();
		// 开始检查订单
		// startCheckOrder();
	}

	/**
	 * 搜索标题
	 */
	function searchMsg(){
		var keyword = Utils.trim(document.forms['searchForm'].elements['keyword'].value);
		var msgType = document.forms['searchForm'].elements['msg_type'].value;
		listTable.filter['keywords'] = Utils.trim(document.forms['searchForm'].elements['keyword'].value);
		listTable.filter['msg_type'] = document.forms['searchForm'].elements['msg_type'].value;
		listTable.filter['page'] = 1;
		listTable.loadList();
	}

	function confirm_bath(){
		var action = document.forms['listForm'].elements['sel_action'].value;
		if (action == 'allow'||action == 'remove'||action == 'deny'){
			  return confirm(cfm[action]);
		}
	}
</script>